From: Stefan Monnier Date: Mon, 14 May 2001 20:52:07 +0000 (+0000) Subject: (Fdefvar): Only record (defvar ) in the load-history X-Git-Tag: archive/raspbian/1%29.2+1-2+rpi1~1^2~40306 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:///%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:/?a=commitdiff_plain;h=e7fcbe416ce8b8c323b0ebd2578bc9cae7e219b0;p=emacs.git (Fdefvar): Only record (defvar ) in the load-history in has no default value yet. --- diff --git a/src/eval.c b/src/eval.c index f7dd17eb5ea..42dcc814bb6 100644 --- a/src/eval.c +++ b/src/eval.c @@ -686,21 +686,28 @@ If INITVALUE is missing, SYMBOL's value is not set.") if (!NILP (Fcdr (Fcdr (tail)))) error ("too many arguments"); + tem = Fdefault_boundp (sym); if (!NILP (tail)) { - tem = Fdefault_boundp (sym); if (NILP (tem)) - Fset_default (sym, Feval (Fcar (Fcdr (args)))); - } - tail = Fcdr (Fcdr (args)); - if (!NILP (Fcar (tail))) - { - tem = Fcar (tail); - if (!NILP (Vpurify_flag)) - tem = Fpurecopy (tem); - Fput (sym, Qvariable_documentation, tem); + Fset_default (sym, Feval (Fcar (tail))); + tail = Fcdr (tail); + if (!NILP (Fcar (tail))) + { + tem = Fcar (tail); + if (!NILP (Vpurify_flag)) + tem = Fpurecopy (tem); + Fput (sym, Qvariable_documentation, tem); + } + LOADHIST_ATTACH (sym); } - LOADHIST_ATTACH (sym); + else + /* A (defvar ) should not take precedence in the load-history over + an earlier (defvar ), so only add to history if the default + value is still unbound. */ + if (NILP (tem)) + LOADHIST_ATTACH (sym); + return sym; }